<template>
	<div class="content" style="height: 100%;">
		<scroll-view scroll-y="true" class="scroll-view" :scroll-top='scrollTop' style="height: 100%;">
			<div>
				<div class="bj"></div>
				<!--轮播-->
				<div class="uni-margin-wrap">
					<swiper class="swiper" circular :indicator-dots="none" :autoplay="autoplay" :interval="interval" :duration="duration">
						<swiper-item v-for="(item, index) in  background" v-bind:key="index">
							<div class="swiper-item">
								<image class="swiperImg" lazy-load="true" :src="item.url" @click="bannerLink(item)" alt=""></image>
								<!-- <img class="swiperImg" :src="utils.imgSrc(item.showImg)" @click="bannerLink(item)" alt=""> -->
							</div>
						</swiper-item>
					</swiper>
				</div>

				<!-- 搜索-->
				<div class="search-box" style="position: relative;height: 130rpx;">
					<div class="search">
						<div class="logo">
							<img src="../../static/logo_w.png" style="width: 60px; height:24px;" alt="">
						</div>
						<input style="color: #000;" class="put" placeholder="想住哪儿？" placeholder-style="color: #dedede" :value="inputClearValue" @input="inputvalue"></input>

						<div class="btm">
							<div class="mapIcon" @tap="map(longitude, latitude)">
								<img style="width:50rpx;height:50rpx;" src="../../static/map.png" alt="地图定位">
							</div>
							<div class="seach" @click="listAppFunRest">
								<img class="ss" src="../../static/ss.png" alt="">
							</div>


							<!-- <button>地图</button> -->
						</div>

					</div>

				</div>
				<!-- 地图 -->
				<!-- 		<div class="ad">
					<img src="../../static/tongqin.png" style="width: 255px; height: 68px;" alt="">
					<img src="../../static/shouc.png" style="width: 115px; height: 67px;" alt="">
				</div> -->

				<!--nav-->

				<div style="height: 82px;" v-if='showNav || scorllBool'></div>
				<uni-nav-bar :fixed="true" :statusBar="true" style="position: fixed;top: 0;left: 0;" v-if='showNav || scorllBool' title="逸居盛京"></uni-nav-bar>
				<div class="" id="editor" ref="myElement" :style="{ top: `${statusBarHeight}px` }" :class="{ 'wrapFixed': showNav || scorllBool }">
					<ul class="wrap" style="border: 0; height: 36px; padding-bottom: 0px;width: 730rpx;margin: 0 auto;">
						<li class="liNav" @click="navclick(1)">
							<div class="liCon" :class="{ 'liConCur': arrNav[0] > 0 }">
								<div class="txt" :class="qys == 1 ? 'txt-tap' : ''">{{ qyvalue }} <span v-if="arrNav[0] > 0"></span>
									<!-- streetId || this.metroId || this.stationId ||  this.areaId -->
								</div>
								<!-- <div class="txt">全部区域 <span v-if="arrNav[0]>0">({{arrNav[0]}})</span></div> -->
								<img src="https://gateway.yijushenyang.com/static/build/tab.png" mode="widthFix" class="tab tab1" alt="">
								<img src="https://gateway.yijushenyang.com/static/build/up2.png" mode="widthFix" class="tab tab2" alt="">
							</div>
						</li>
						<li class="liNav" @click="sort(1)">
							<div class="liCon" :class="{ 'liConCur': arrNav[1] > 0 }">
								<!-- <div class="txt">单价排序 <span v-if="arrNav[1]>0">({{arrNav[1]}})</span></div> -->
								<div class="txt" :class="priceOrders == true ? 'txt-tap' : ''">单价排序 <span v-if="arrNav[1] > 0"></span></div>
								<!-- <img src="https://gateway.yijushenyang.com/static/build/tab.png"  mode="widthFix" class="tab tab1" alt=""> -->
								<!-- <img src="https://gateway.yijushenyang.com/static/build/up2.png"  mode="widthFix" class="tab tab2" alt=""> -->
							</div>
						</li>
						<li class="liNav" @click="sort(2)">
							<div class="liCon" :class="{ 'liConCur': arrNav[2] > 0 }">
								<!-- <div class="txt">距离最近 <span v-if="arrNav[2]>0">({{arrNav[2]}})</span></div> -->
								<div class="txt">距离最近 <span v-if="arrNav[2] > 0"></span></div>
								<!-- <img src="https://gateway.yijushenyang.com/static/build/tab.png"  mode="widthFix" class="tab tab1" alt=""> -->
								<!-- <img src="https://gateway.yijushenyang.com/static/build/up2.png"  mode="widthFix" class="tab tab2" alt=""> -->
							</div>
						</li>
						<li class="liNav" @click="navclick(4)">
							<div class="liCon" :class="{ 'liConCur': arrNav[2] > 0 }">
								<div class="txt" :class="gjs == 1 ? 'txt-tap' : ''">房源筛选 <span v-if="arrNav[3] > 0">({{ arrNav[3] }})</span>
								</div>
								<img src="https://gateway.yijushenyang.com/static/build/tab.png" mode="widthFix" class="tab tab1" alt="">
								<img src="https://gateway.yijushenyang.com/static/build/up2.png" mode="widthFix" class="tab tab2" alt="">
							</div>
						</li>
					</ul>
					<!-- <div class="wrap" style="border: 0; margin-top: 0; white-space: nowrap; display: block; ">
						<div class="liTab">
							免租30天
						</div>
						<div class="liTab">
							近地铁
						</div>
						<div class="liTab">
							优惠
						</div>
						<div class="liTab">
							商旅短租
						</div>
						<div class="liTab">
							VR看房
						</div>
					</div> -->
				</div>

				<div class="conFixed" :style="{ top: `${statusBarHeight + 36}px` }" v-if="showNav">
					<!-- <div class="conFixed" :style="{ top: `${statusBarHeight+36}px` }" v-if="showNav" @tap.stop="showNavfun"> -->
					<div class="conFixedW">
						<div class="fysx" v-if="nav == 1" scroll-y="true" style="display: flex;border: 1rpx solid #f0f0f0;">
							<!-- 一级 -->
							<scroll-view class="qy-tab-left" scroll-y="true" @tap.stop="">
								<div class="qy-tab-left-item" v-for="(item, index) in sxTab" :key="index" :class="item.checked == true ? 'qy-tab-left-item-checked' : ''" @tap.stop='navClickFun(item, index)'>
									{{ item.h }}
								</div>
							</scroll-view>
							<!-- 二级 -->
							<scroll-view class="qy-tab-center" scroll-y="true" @tap.stop="">
								<div class="qy-tab-center-item" v-for="(item, index) in sxTabS" :key="index" :class="item.checked == true ? 'qy-tab-center-item-checked' : ''" @tap.stop="seClick(item, index)">
									{{ item.value }}
								</div>

							</scroll-view>
							<!-- 三级 -->
							<scroll-view class="qy-tab-right" scroll-y="true" @tap.stop="">
								<div class="qy-tab-center-item" :class="item.checked == true ? 'qy-tab-right-item-checked' : ''" v-for="(item, index) in sxTabT" :key="index" @tap.stop="thClick(item, index)">

									<div>{{ item.value }}</div>
									<img class="benefits" :src="item.checked == true ? '../../static/benefits.png' : ''" alt="">
								</div>
							</scroll-view>
						</div>

						<scroll-view class="fysx" v-if="nav == 4" scroll-y="true" @tap.stop="">
							<div class="fysx-h-flex">
								<div>价格区间（元）</div>
								<div style="color: #f56800;margin-right: 20rpx;">{{ lowestPrice }}-{{ highest }}</div>
							</div>
							<!-- slider -->
							<cj-slider class="slider" v-model="priceValue" :min="0" :max="10000" :step="100" :blockWidth="40" @moving="blockMoving" />

							<div>
								<div class="fysx-h">户型选择</div>
								<div class="fysx-flex">
									<div class="fysx-item" :class="item.checked == true ? 'fysx-item-checked' : ''" @tap.stop="type(item, index)" v-for="(item, index) in fysxType" :key="index">
										{{ item.type }}
									</div>
								</div>
							</div>

							<div>
								<div class="fysx-h">面积区间</div>
								<div class="fysx-flex">
									<div class="fysx-item" :class="item.checked == true ? 'fysx-item-checked' : ''" @tap.stop="zlmjType(item, index)" v-for="(item, index) in mjType" :key="index">
										{{ item.type }}
									</div>
								</div>
							</div>
						</scroll-view>
						<div class="btmSure">
							<div class="reset" @click="resetFun">重置</div>
							<div class="buttom" @click="listAppFunRest">确定</div>
						</div>
					</div>
				</div>

				<div class="listCon">
					<ul class="ul" style="padding: 0;" v-if="list.length > 0">
						<li class="li" v-for="(item, i) in list" :key="i" @tap.stop='linkDetail(item)'>
							<div class="liWrap">
								<div class="title">
									{{ item.deptName }}
									<div class="titlePeo" v-if="item.resCount != 0"><span style="margin-right: 5rpx;">到店人数</span>{{ item.resCount }}</div>
								</div>
								<div class="label">
									<!-- <div class="lab" style="background-color: #e0f3fe; color: #00a0f5;">免租30天</div> -->
									<div class="lab" v-for="(item1, i1) in item.storeLabelList" :key="i">{{ item1 }}
									</div>
								</div>
								<div class="address">
									<div><span style="margin-right: 10rpx;">{{ item.area }}</span>{{ item.street }}｜<span style="margin-right: 10rpx;">{{ item.metro }}</span>{{ item.station }}站
									</div>
								</div>

								<scroll-view scroll-x="true" style="width: 100%;height: auto; white-space: nowrap;">
									<view class="item-grid" v-for="(item1, i1) in item.modelList" :key="i1" @tap.stop='roomDetail(item1)'>
										<image lazy-load="true" :src="item1.showUrl" style="width: 100px; height:80px; border-radius: 8px;" alt=""></image>
										<view class="roomName">{{ item1.modelName }}</view>
										<view class="money" v-if="item1.num != 0">
											<text style='font-size: 32rpx;color: #f56800;margin-right: 5rpx;'>{{ item1.minPrice }}</text><text style="font-size: 22rpx;">元/月起</text>
										</view>
										<view class="money" v-if="item1.num == 0">
											<text style='font-size: 32rpx;color: #f56800;'>已罄</text>
										</view>
									</view>
								</scroll-view>
							</div>

						</li>
						<div class="load" v-show="isLoadDowning == 1">
							<img class="loadImg" src="https://gateway.yijushenyang.com/static/img/loading.png" alt="">
							<span>加载中</span>
						</div>
						<div class="load" v-show="isLoadDowning == 2">
							<span>没有更多了～</span>
						</div>
					</ul>
					<div v-else style="text-align: center; font-size: 14px;">
						<img src="https://gateway.yijushenyang.com/img/none.png" style="margin: 0 auto; margin-top: 40px; width: 50px; height:50px;" alt="">
						<div class="" style="margin-top: 10px; color: #999;">
							暂无数据
						</div>
					</div>
				</div>
			</div>
			<div class="footerPo">
				<div class="liFoot cur" @tap.stop="tabbarClick('home')">
					<img src="../../static/sy.png" class="liImg2" alt="">
					<div class="">首页</div>
				</div>
				<div style="color: #f0f0f0; line-height: 50px;">|</div>
				<div class="liFoot" @tap.stop="tabbarClick('my')">
					<img src="../../static/my1.png" class="liImg" alt="">
					<div class="">我的</div>
				</div>
			</div>
		</scroll-view>
	</div>
</template>

<script module="utils" lang="wxs" src="../../utils/imgSrc.wxs"></script>

<script>
	import cjSlider from '@/components/jxs-slider/jxs-slider.vue'
	import config from '../../config.js';
	import uniNavBar from "@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-nav-bar.vue"
	var QQMapWX = require('../../utils/qqmap-wx-jssdk.js');
	var qqmapsdk;

	export default {
		components: {
			cjSlider,
			uniNavBar
		},
		data() {
			return {
				latitude: null, // 地图数据
				longitude: null, //地图数据
				statusBarHeight: uni.getSystemInfoSync().statusBarHeight + 44,
				priceValue: [0, 10000], // 可以指定默认值
				isLoadDowning: 0,
				loadBottom: true,
				pageNum: 1,
				pageSize: 10,
				arrNav: [1, 3, 2, 0],
				inputClearValue: '',
				sxTab: [{
						h: '区域',
						checked: true,
					},
					{
						h: '地铁',
						checked: false,
					},
				],
				sxTabS: [],
				sxTabVa: [],
				sxTabT: [],
				qys: 0,
				qyv: '全部区域',

				searchValue: '',
				mjList: [{
						name: '不限',
						bool: 1,
						value: ''
					},
					{
						name: '50',
						bool: 0,
						value: '0 and 50'
					},
					{
						bool: 0,
						name: '50-70',
						value: '50 and 70',
					},
					{
						bool: 0,
						name: '70-90',
						value: '70 and 90',
					},
					{
						bool: 0,
						name: '90-110',
						value: '90 and 110',
					},
					{
						bool: 0,
						name: '110-130',
						value: '110 and 130',
					},
					{
						bool: 0,
						name: '130-150',
						value: '130 and 150',
					},
					{
						bool: 0,
						name: '150',
						value: '150 and 100000',
					}
				],
				hxList: [{
						bool: 1,
						name: '全部',
						value: ''
					},
					{
						bool: 0,
						name: '1居',
						value: '一'
					},
					{
						bool: 0,
						name: '2居',
						value: '二'
					},
					{
						bool: 0,
						name: '3居',
						value: '三'
					},
					{
						bool: 0,
						name: '4居',
						value: '四'
					},
					{
						bool: 0,
						name: '5居+',
						value: '五'
					},
					{
						bool: 0,
						name: '商业',
						value: '商业'
					},
					{
						bool: 0,
						name: '公寓',
						value: '公寓'
					},
					{
						bool: 0,
						name: '别墅',
						value: '别墅'
					},
				],
				djList: [{
						bool: 1,
						name: '全部',
						value: ''
					},
					{
						bool: 0,
						name: '5000',
						value: '0 and 5000'
					},
					{
						bool: 0,
						name: '5000-8000',
						value: '5000 and 8000',
					},
					{
						bool: 0,
						name: '8000-10000',
						value: '8000 and 10000',
					},
					{
						bool: 0,
						name: '10000-13000',
						value: '10000 and 13000',
					},
					{
						bool: 0,
						name: '13000-16000',
						value: '13000 and 16000',
					},
					{
						bool: 0,
						name: '16000',
						value: '16000 and 1000000',
					}
				],
				cityList: [{
						bool: 0,
						name: '全部',
						value: ''
					},
					{
						bool: 0,
						name: '和平区',
						value: '和平',
					},
					{
						bool: 0,
						name: '沈河区',
						value: '沈河',
					},
					{
						bool: 0,
						name: '大东区',
						value: '大东',
					},
					{
						bool: 0,
						name: '皇姑区',
						value: '皇姑',
					},
					{
						bool: 0,
						name: '铁西区',
						value: '铁西',
					},
					{
						bool: 0,
						name: '苏家屯区',
						value: '苏家屯',
					},
					{
						bool: 0,
						name: '浑南区',
						value: '浑南',
					},
					{
						bool: 0,
						name: '沈北新区',
						value: '沈北',
					},
					{
						bool: 0,
						name: '于洪区',
						value: '于洪',
					},
					{
						bool: 0,
						name: '经济技术开发区',
						value: '经济技术开发区',
					}
				],
				scrollTop: 0,
				old: {
					scrollTop: 0
				},
				navtop: 1,
				qyvalue: '全部区域',
				background: ['color1', 'color2', 'color3'],
				indicatorDots: true,
				autoplay: true,
				interval: 3000,
				duration: 500,
				scorllBool: false, // 滚动
				showNav: false, // 筛选的展示
				nav: 0, // //切换
				list: [],
				h: '区域',
				areaId: '',
				maxArea: '',
				minArea: '',
				streetId: '',
				metroId: '',
				stationId: '',

				area: '',
				street: '',
				metro: '',
				station: '',

				modelType: '',
				lowestPrice: 0,
				highestPrice: 10000,
				highest: '不限',
				priceOrders: false,
				priceOrder: 0,
				fysxType: [{
					type: '单间',
					id: 1,
					checked: false,
				}, {
					type: 'LOFT',
					id: 2,
					checked: false,
				}, {
					type: '一房一厅',
					id: 3,
					checked: false,
				}, {
					type: '两房以上',
					id: 4,
					checked: false,
				}, ],

				gjs: 0,

				mjType: [{
					type: '15m²',
					min: 0,
					max: 15,
					checked: false,
				}, {
					type: '15-30m²',
					id: 2,
					min: 15,
					max: 30,
					checked: false,
				}, {
					type: '30-45m²',
					id: 3,
					min: 30,
					max: 45,
					checked: false,
				}, {
					type: '45m²以上',
					id: 4,
					min: 45,
					max: 999,
					checked: false,
				}, ],
			}
		},
		onLoad(option) {
			if (!uni.getStorageSync('openId')) {
				uni.setStorageSync('permission', 0)
			}

			// this.getSystemInfo()
			if (option.value) {
				this.searchValue = option.value
			}
			this.imgsList()
			// 滚动问题
			const query = uni.createSelectorQuery().in(this);
			query.select('#editor').boundingClientRect(data => {
				this.navtop = data.top

			}).exec();
		},

		onReady() {
			this.areaFun()
		},

		onShow() {
			this.listAppFun()
		},

		onShareAppMessage(res) { //发送给朋友
			return {
				title: '逸居盛京',
				path: '/pages/home/index',
				imageUrl: "",
			}
		},
		onShareTimeline(res) { //分享到朋友圈
			return {
				title: '逸居盛京',
				path: '/pages/home/index',
				imageUrl: "",
			}
		},
		methods: {
			// 跳转地图 lon,lat
			map() {
				uni.getSystemInfo({
					success: (res) => {
						if (!res.locationEnabled || !res.locationAuthorized) {
							uni.showToast({
								title: '请确保手机系统定位已开启',
								icon: 'none',
								duration: 2000,
							})
						} else {
							uni.getLocation({
								type: 'gcj02',
								success: res => {
									this.latitude = res.latitude
									this.longitude = res.longitude
									uni.chooseLocation({
										success: res => {
											var mapCoordinates = {
												latitude: res.latitude,
												longitude: res.longitude
											}
											console.log(mapCoordinates, '点击位置的经纬度');
											this.inputClearValue = res.name
										},
										fail: function() {
										},
										complete: function() {
											
										}
									})
								},fail() {
										uni.showModal({
										  title: '提示',
										  content: '地图定位需要获取用户位置信息权限',
										  confirmText: '前往设置',
										  confirmColor: '#3CC51F',
										  success(res) {
										    if (res.confirm) {
										      uni.openSetting(); // 打开小程序设置页面，可以让用户开启需要的权限
										    }
										  }
										})
								}
							
							})
							// const location = this.getLocationInfo();
						}
					}
				})
		
			},
			tabbarClick(e) {
				// console.log(e);
				// if (e == 'my') {
				// 	uni.showToast({
				// 		title: '此功能暂未开放',
				// 		icon: 'none',
				// 		duration: 1500,
				// 	});
				// } else {
				// 		uni.navigateTo({
				// 		url: '/pages/' + e + '/' + e
				// 	})
				// }

				if (e == 'home') {
					uni.navigateTo({
						url: '/pages/' + home + '/' + e
					})
				} else {
					uni.navigateTo({
						url: '/pages/' + e + '/' + e
					})
				}
			},
			search() {
				uni.navigateTo({
					url: '/pages/home/search'
				})
			},
			sort(e) {
				if (e == 1) {
					this.priceOrders = !this.priceOrders
					if (this.priceOrders == true) {
						this.priceOrder = 1
						this.listAppFun()
					} else {
						this.priceOrder = 0
						this.priceOrders = false
						this.listAppFun()
					}


				}
			},

			inputvalue(e) {
				this.inputClearValue = e.detail.value
			},

			blockMoving() {
				// console.log('正在滑动中', this.priceValue)
				// lowestPrice: 0,
				// highestPrice: 10000,
				// highest: '不限',
				this.lowestPrice = this.priceValue[0]
				this.highestPrice = this.priceValue[1]
				if (this.highestPrice == 10000) {
					this.highest = '不限'
				} else {
					this.highest = this.highestPrice
				}
			},

			async getSystemInfo() { // function 自定义（事例）
			
			},

			//获取位置信息
			// getLocationInfo() {
			// 	return new Promise((resolve) => {
			// 		//位置信息默认数据
			// 		let location = {
			// 			longitude: 0,
			// 			latitude: 0,
			// 			province: "",
			// 			city: "",
			// 			area: "",
			// 			street: "",
			// 			address: "",
			// 		};
			// 		uni.getLocation({
			// 			type: "gcj02",
			// 			success(res) {
			// 				location.longitude = res.longitude;
			// 				location.latitude = res.latitude;
			// 				const qqmapsdk = new QQMapWX({
			// 					key: 'KDKBZ-OOQHQ-6PD5R-2CXWF-MXXN3-QJFVP'
			// 				});

			// 				qqmapsdk.reverseGeocoder({
			// 					location,
			// 					success(response) {
			// 						console.log(response)
			// 						resolve(location);
			// 					},
			// 				});
			// 			},
			// 			fail(err) {
			// 				resolve(location);
			// 			},
			// 		});
			// 	}).then(res => {
			// 		// console.log(res)
			// 		// 用户拒绝授权
			// 		if (res.province == '') {
			// 			uni.setStorageSync('lng')

			// 		} else {}
			// 	})
			// },


			// showNavfun() {
			// 	this.showNav = false
			// 	this.nav = 0
			// 	this.lowestPrice = 0
			// 	this.highestPrice = 10000
			// 	this.priceValue = [0, 10000]
			// 	this.highest = '不限'

			// },
			resetFun() {
				this.showNav = false
				this.list = []
				this.areaId = ''
				this.maxArea = ''
				this.minArea = ''
				this.streetId = ''
				this.metroId = ''
				this.stationId = ''
				this.modelType = ''
				this.priceOrder = 0

				this.priceValue = [0, 10000]
				this.lowestPrice = this.priceValue[0]
				this.highestPrice = this.priceValue[1]
				this.highest = '不限'

				this.priceOrders = false
				this.gjs = 0
				this.inputClearValue = ''
				this.$set(this.sxTab[0], 'checked', true)
				this.$set(this.sxTab[1], 'checked', false)

				for (let i = 0; i < this.fysxType.length; i++) {
					this.$set(this.fysxType[i], 'checked', false)
				}

				for (let i = 0; i < this.mjType.length; i++) {
					this.$set(this.mjType[i], 'checked', false)
				}
				// this.qybtn = false
				this.qyv = '全部区域'
				this.areaFun()
				this.metroFun()
				this.listAppFun()
			},
			resecList(obj) {
				for (var i = 0; i < obj.length; i++) {
					if (i == 0) {
						obj[0].bool = 1
					} else {
						obj[i].bool = 0
					}
				}
				return obj
			},
			listAppFunRest() {
				this.list = []
				this.listAppFun()
			},
			upper: function(e) {
				// console.log(e)

			},
			lower: function(e) {
				if (this.loadBottom) {
					this.isLoadDowning = 1
					this.pageNum += 1;
					this.listAppFun()
				} else {
					this.isLoadDowning = 2
				}
				// console.log(e)
			},
			// banner  跳转
			bannerLink(item) {
				if (!item.httpUrl) {
					return
				}
				if (item.identifier == 1) {
					// h5
					uni.navigateTo({
						url: '/pages/webView/webView?url=' + item.httpUrl
					})
				} else {
					// 小程序内部链接
					uni.navigateTo({
						url: item.httpUrl
					})
				}
			},
			// banner 请求
			imgsList() {
				let param = {}
				this.api.get('neirong/imgs/app/imgsAppAll', param).then(res => {
					let urlArr = []
					let data = res.data.data
					let background = []

					for (var i = 0; i < res.data.data.length; i++) {
						urlArr[i] = res.data.data[i].imgsUrl
					}

					if (res.data.data.length > 1) {
						urlArr = urlArr.join(',')
					} else {
						urlArr = urlArr.join('')
					}

					let url = 'resource/oss/listByIds/' + urlArr
					this.api.get(url, '').then(url => {
						for (let l = 0; l < url.data.data.length; l++) {
							background[l] = Object.assign({}, data[l], url.data.data[l]);
						}
						this.background = background
					})
				})
			},
			callBackFun(arr, obj, num) {
				// arr 是数组， obj，是空数组， num 是用于页面显示的nav选择第几个
				if (arr[0].bool != 1) {
					for (var i = 0; i < arr.length; i++) {
						if (arr[i].bool == 1) {
							obj.push(arr[i].value)
						}
					}
				}
				this.arrNav[num] = obj.length
				return obj
			},
			// 列表
			listAppFun() {
				const $this = this
				let pream = {
					storeAddress: $this.inputClearValue,
					areaId: $this.areaId,
					maxArea: $this.maxArea,
					minArea: $this.minArea,
					streetId: $this.streetId,
					metroId: $this.metroId,
					stationId: $this.stationId,
					modelType: $this.modelType,
					lowestPrice: $this.lowestPrice,
					highestPrice: $this.highestPrice,
					priceOrder: $this.priceOrder,
				}

				$this.api.get('fangyuan/store/app/appList', pream).then(listApp => {
					if (listApp.data.code == 200) {
						$this.isLoadDowning = 0
						$this.list = listApp.data.data

						if (listApp.data.data.length < 0) {
							this.loadBottom = true
						} else {
							this.isLoadDowning = 2
							this.loadBottom = false
						}
						this.showNav = false

						// if (this.qybtn == true) {
						// this.qybtn = false
						if (this.streetId || this.metroId || this.stationId || this.areaId) {
							this.qys = 1
							if (this.streetId) {
								this.qyvalue = this.street
							} else if (this.metroId) {
								this.qyvalue = this.metro
							} else if (this.stationId) {
								this.qyvalue = this.station
							} else if (this.areaId) {
								this.qyvalue = this.area
							}
						} else {
							this.qys = 0
							this.qyvalue = '全部区域'
						}

						if (this.maxArea || this.minArea || this.modelType || this.lowestPrice != 0 || this
							.highest != '不限') {
							console.log('yes')
							this.gjs = 1

						} else {
							console.log('no')
							this.gjs = 0
						}

					} else {
						uni.showToast({
							title: listApp.data.msg,
							icon: 'none',
							duration: 1500,
						});
					}
				})
			},

			type(item, index) {
				this.modelType = item.id
				for (let i = 0; i < this.fysxType.length; i++) {
					if (index == i) {
						this.$set(this.fysxType[i], 'checked', !this.fysxType[i].checked)
						if (this.fysxType[i].checked == false) {
							this.modelType = ''
						}
						continue
					} else {
						this.$set(this.fysxType[i], 'checked', false)
					}
				}
			},

			zlmjType(item, index) {
				this.maxArea = item.max
				this.minArea = item.min
				for (let i = 0; i < this.mjType.length; i++) {
					if (index == i) {
						this.$set(this.mjType[i], 'checked', !this.mjType[i].checked)
						if (this.mjType[i].checked == false) {
							this.maxArea = ''
							this.minArea = ''
						}
						continue
					} else {
						this.$set(this.mjType[i], 'checked', false)
					}
				}
			},

			navClickFun(item, index) {
				for (let i = 0; i < this.sxTab.length; i++) {
					if (index == i) {
						this.$set(this.sxTab[i], 'checked', true)
						continue;
					} else {
						this.$set(this.sxTab[i], 'checked', false)
					}
				}

				if (item.h == '区域') {
					this.areaFun()
					this.h = '区域'
				} else if (item.h == '地铁') {
					this.metroFun()
					this.h = '地铁'
				}
			},

			thClick(item, index) {
				if (this.h == '区域' || this.h == '') {
					this.streetId = item.id
					this.street = item.h
				} else if (this.h == '地铁') {
					this.metroId = item.id
					this.metro = item.h
				}

				for (let i = 0; i < this.sxTabT.length; i++) {
					if (index == i) {
						this.$set(this.sxTabT[i], 'checked', true)
						continue
					} else {
						this.$set(this.sxTabT[i], 'checked', false)
					}
				}
			},

			seClick(item, index) {
				console.log(item)
				if (this.h == '区域') {
					this.areaId = item.id
					this.area = item.area
				} else if (this.h == '地铁') {
					this.metroId = item.id
					this.metro = item.metro
				}


				for (let i = 0; i < this.sxTabS.length; i++) {
					if (index == i) {
						this.$set(this.sxTabS[i], 'checked', true)
						this.sxTabT = this.sxTabS[i].list

						for (let l = 0; l < this.sxTabT.length; l++) {
							this.$set(this.sxTabT[l], 'checked', false)
							this.$set(this.sxTabT[0], 'checked', true)
							continue
						}
						continue;
					} else {
						this.$set(this.sxTabS[i], 'checked', false)
					}
				}
			},

			// area
			areaFun() {
				const $this = this
				let pream = {}
				$this.api.get('neirong/area/app/areaAndStreetApp', pream).then(areaApp => {
					$this.sxTabS = areaApp.data.data
					// $this.sxTabS.unshift($this.header);
					// console.log($this.sxTabS)
					if (areaApp.data.code == 200) {
						for (let i = 0; i < $this.sxTabS.length; i++) {
							if (i == 0) {
								$this.$set($this.sxTabS[0], 'checked', true)
								this.sxTabT = this.sxTabS[0].list
								$this.$set($this.sxTabT[0], 'checked', true)
								continue
							} else {
								$this.$set($this.sxTabS[i], 'checked', false)
							}
						}

						for (let l = 0; l < this.sxTabT.length; l++) {
							this.$set(this.sxTabT[l], 'checked', false)
							this.$set(this.sxTabT[0], 'checked', true)
						}
					}
				})
			},

			// metro
			metroFun() {
				const $this = this
				let pream = {}
				$this.api.get('neirong/metro/app/metroAndStationApp', pream).then(res => {
					// console.log(res.data.data)
					this.sxTabS = res.data.data
					if (res.data.code == 200) {
						for (let i = 0; i < this.sxTabS.length; i++) {
							if (i == 0) {
								this.$set(this.sxTabS[0], 'checked', true)
								this.sxTabT = this.sxTabS[0].list
								$this.$set($this.sxTabT[0], 'checked', true)
								continue
							} else {
								this.$set(this.sxTabS[i], 'checked', false)
							}
						}

						for (let l = 0; l < this.sxTabT.length; l++) {
							this.$set(this.sxTabT[l], 'checked', false)
							this.$set(this.sxTabT[0], 'checked', true)
						}
					}
				})
			},

			cityFun(index, obj) {
				// console.log(index)
				// console.log(obj[index].bool)
				if (index == 0) {
					for (var i = 0; i < obj.length; i++) {
						obj[i].bool = 0
					}
					obj[0].bool = 1
				} else {
					if (this.nav == 3) {
						for (var i = 0; i < obj.length; i++) {
							obj[i].bool = 0
						}
						obj[index].bool = 1
					} else {
						obj[0].bool = 0
						obj[index].bool = obj[index].bool == 1 ? 0 : 1
					}
				}
			},
			// 看直播
			lookTV(item) {
				// console.log(item.path + item.broadcastNum, )
				uni.navigateToMiniProgram({
					appId: item.appId,
					path: item.path + item.broadcastNum,
					success(res) {
						// 打开成功 
					},
					complete: (res) => {
						// console.log('直播间信息', res)
					},
				})
			},
			onScroll(e) {
				if (e.detail.scrollTop > this.navtop) {
					this.scorllBool = true
				} else {
					this.scorllBool = false
				}
				this.old.scrollTop = e.detail.scrollTop
			},
			// 展示筛选
			navclick(num) {
				this.scrollTop = this.old.scrollTop
				this.$nextTick(function() {
					this.scrollTop = this.navtop
				});
				this.showNav = true
				this.linknav(num)
			},
			// 切换条件
			linknav(num) {
				this.showNav = true
				this.nav = num
			},
			linkDetail(item) {
				uni.navigateTo({
					url: '/pages/builds/detail?id=' + item.deptId
				})
			},

			roomDetail(i) {
				if (i.num == 0) {
					uni.showToast({
						title: '该房源已罄',
						icon: 'none',
						duration: 1500,
					});
				} else {
					uni.navigateTo({
						url: '/pages/builds/room?modelId=' + i.modelId + '&deptId=' + i.deptId
					})
				}
			},

		}
	}
</script>

<style>
@import '/common/css/index/index.scss';
</style>

<style lang="scss">
.uni-status-bar {
	height: 20px;
}

.search-box {
	margin-top: -72rpx;

	.search {
		width: 100%;
		padding: 0 20rpx;
		left: 0;

		.logo {
			top: 26rpx;
			padding: 0;
			left: 58rpx;

			// img:after {
			// 	// content: "•";
			// 	// top: 0rpx;
			// 	content: "︱";
			// 	top: 5rpx;
			// 	position: absolute;
			// 	right: -32rpx;
			// 	color: #666;
			// }

		}

		.btm {
			width: 200rpx;
			height: 80rpx;
			border-radius: 0 40rpx 40rpx 0;
			top: unset;
			right: 20rpx;
			display: flex;
			justify-content: space-around;
			align-items: center;
		}

		.seach {
			width: 50%;
			height: 100%;
			line-height: 110rpx;

			.ss {
				width: 50rpx;
				height: 50rpx;
				margin: 0;

			}
		}

		.put {
			padding-left: 178rpx;
			padding-right: 210rpx;
			height: 80rpx;
			border-radius: 40rpx;
			margin-bottom: 0;
			border: unset;
			box-shadow: 0.5px 0.5px 5px 0px rgba(0, 0, 0, 0.1);
		}
	}
}

.listCon {
	.li {
		border-radius: 20rpx;
		box-shadow: 0.5px 0.5px 5px 0px rgba(0, 0, 0, 0.1);
	}

	.lab {
		display: inline-block;
		padding: 2rpx 10rpx;
		font-size: 20rpx;
	}
}

.item-grid {
	display: inline-block;
	margin-right: 10px;
	font-size: 12px;
	width: 100px;
	display: inline-block;
	padding: 20rpx 0;
}

.item-grid:last-child {
	display: inline-block;
	// margin-right: 10px;
	font-size: 12px;
	width: 100px;
	display: inline-block;
	padding: 20rpx 0;
}

.mapIcon {
	width: 50%;
	height: 100%;
	line-height: 110rpx;
	position: relative;
}

.mapIcon::after {
	content: ' ';
	width: 2rpx;
	height: 45rpx;
	background: #fff;
	// border-right: 2rpx solid red;
	position: absolute;
	top: 20rpx;
	left: 100rpx;
}
</style>
